package Interface;

import Animation.DiceAnimPanel;
import com.sun.opengl.util.Animator;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.media.opengl.GLCapabilities;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.border.Border;

public class DicePanel extends JPanel implements Runnable
{
    static Animator anim;
    DiceAnimPanel animPanel;
    GLCapabilities capabilities;

    public DicePanel()
    {
        capabilities = new GLCapabilities();
        animPanel = new DiceAnimPanel(capabilities);

        Border whiteLine = BorderFactory.createLineBorder(Color.yellow,5);
        setBorder(whiteLine);
        setBackground(Color.darkGray);
        setSize(100,200);
        setLayout(new GridLayout(1,1));
        add(animPanel);

        Thread beginAnimation = new Thread(this);
        beginAnimation.start();

    }


        public void run() {
        anim = new Animator(animPanel);
        anim.start();
    }
        
}